import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;

public class RandomNumberGenerator {
    public static void main(String[] args) {
        int times = 5; // 生成5注
        Random random = new Random(); // 随机种子

        for (int i = 1; i <= times; i++) {
            List<Integer> firstList = generateRandomList(1, 35, 5, random);
            List<Integer> lastList = generateRandomList(1, 12, 2, random);

            Collections.sort(firstList); // 前区排序
            Collections.sort(lastList);  // 后区排序

            System.out.println("第" + i + "注大乐透：前区 " + firstList + " | 后区 " + lastList);
        }
    }

    private static List<Integer> generateRandomList(int start, int end, int count, Random random) {
        List<Integer> list = new ArrayList<>();
        for (int i = start; i <= end; i++) {
            list.add(i);
        }
        Collections.shuffle(list, random); // 使用随机种子打乱
        return new ArrayList<>(list.subList(0, count));
    }
}
